<?php


class MaterialsUsed extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('mat');
        $this->hasColumn('order_id', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
             'primary' => true,
             ));
        $this->hasColumn('part_number', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
            'primary' => true,
             ));
        $this->hasColumn('name', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('type', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('required', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
             ));
        $this->hasColumn('used', 'integer', null, array(
             'type' => 'integer',
             'notnull' => true,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('Part', array(
             'local' => 'part_number',
             'foreign' => 'part_number'));
        
        $this->hasMany('_Order', array(
             'local' => 'order_id',
             'foreign' => 'id'));
    }
}

?>
